"use restrict";
const tool = require('./jtool.js');
const asyn = require("async");
const fs = require('fs');
const jq = require("cheerio");

var g = {
    u1: "http://www.zjtsks.com/savefsbmb.do",
    u2: "",
    p1: {
        "header": {
            "Accept": "application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*",
            "Content-Type": "multipart/form-data; boundary=---------------------------7e2f532305d0",
            "Cookie": "JSESSIONID=773F8363559CB9248BE33F37ED2E0628; userjg9002=330523110; usercode9002=yangt; userpws9002=123456; savecookie=true"
        },
        "charset": "utf-8"
    },
    p2: "",
    d1: {
        'bmid': '',
        'flag': '',
        's_jglb': '9002',
        'bmjgdm': '330523110',
        's_jgdm': '330523110',
        'pxjgdm': '',
        'sqrxm': '卢成梁',//申请人姓名
        'xb': '1',//性别
        'txdz': '',//通讯地址
        'whcd': '0408',//学历
        'yzbm': '313300',
        'zjlx': '1',//证件类型
        'sfzh': '330523196808030030',//身份证号
        'lxdh': '18657273199',//联系电话（手机）
        'zyzl': '06',//申请复审作业种类
        'zyxm': '0603',//申请复审作业项目(代号)
        'zsbh': '330523196808030030',//证书编号
        'bak4': '2013-01-29',//首次领证日期
        'fzrq': '2017-01-28',//当前证书有效期
        'sfwtfs': '1',
        'lqfs': '1',
        'yrdw': '安吉昱嘉家具厂',//用人单位
        'dwszdq': '3305',
        'dwszqx': '330523',
        'dwdz': '',
        'dwlxr': '',
        'dwlxdh': '',
        'gzjl': '持证期间从事该项目见证明文件。',
        'pxqk': '安全教育培训满足要求，具体证明文件附后。',
        'sqrqzrq': '2017-01-28',//申请人签字日期
        'xgclType': '08'
    },
    d2: "",
    limit: 5,
};
(function tsks() {
    tool.mpost(g.u1, g.p1, g.d1)
        .then(res => {
            // fs.writeFileSync('../tsks.txt',res.text,'utf-8');
            console.log(res.text);
        })
        .catch(err => {
            if (err) console.log(err);
        });
})();
